<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib prefix="sl" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@page import="com.solution.common.config.PublicConfig"%>
<%@page import="com.solution.admin.home.constants.IndexConstants"%>
<%
	String basePath = PublicConfig.ROOT_PATH;
	String imgRootURL = PublicConfig.IMG_ROOT_URL;
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="format-detection" content="telephone=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<title>报价单</title>
<link rel="stylesheet" type="text/css" href="<%=basePath%>/statics_wx/css/style.css?v=20180313">
<style>
.pp_list ul.qxbtn  li i {
   position: absolute;
   cursor: pointer;
   right: 0.2rem;
   top: 50%;
   width: .36rem;
   height: .36rem;
   margin-top: -.17rem;
   background: url(<%=basePath%>/statics_wx/images/icon-q1.png) no-repeat;
    background-size: .35rem .35rem;
}
.pp_list ul.qxbtn  li.current i{ right: 0.2rem;
    top: 50%;
    width: .36rem;
    height: .36rem;
    margin-top: -.17rem;background: url(<%=basePath%>/statics_wx/images/icon-q2.png) no-repeat;background-size:.35rem .35rem;}
}
.pp_list ul.fl_list11 li{border-bottom:0.02rem solid #efefef}
.pp_list ul.fl_list11 li a{font-size:0.28rem;}
</style>
<script src="<%=basePath%>/statics_wx/js/jquery.min.js"></script>
<script type="text/javascript" src="<%=basePath%>/statics_wx/js/custom.js"></script>
<script src="<%=basePath%>/statics_wx/js/js.js"></script>
<script>
$(function(){
	//系统域名 
	var rootPath = '<%=basePath%>';
	// 系统上传文件展示域名
	var imgRootURL = '<%=imgRootURL%>';
	
	//标记报价单当前操作的是哪个模块
	$('.fl_nav1 ul li a').click(function(){
		$(this).parent().siblings().removeClass('current');
		$(this).parent().toggleClass('current');
		//判断分类是否有选择
		if ($("#fl_box ul li").hasClass("current")){
			$("#flbtn").parent().addClass('current');
		}
		//判断品牌是否有选择
		if ($("#brand_box ul li").hasClass("current")){
			$("#brandbtn").parent().addClass('current');
		}
	});
	
	//点击分类和品牌的筛选框空白处，关闭筛选框
	$('body').on('click', function(e){
		//alert($(e.target).attr('class'))
		if ($(e.target).attr('class') == 'fl_dropdown') {
			$('.fl_dropdown').hide();
		}
	})
	
	//点击品牌
	$('#brandbtn').click(function(){
		$('#fl_box').hide();
		$('#brand_box').toggle();
	});
	//点击分类
	$('#flbtn').click(function(){
		$('#brand_box').hide();
		$('#fl_box').toggle();
	});
	
	//价格排序显示
	$('#pricebtn').click(function(){
		$('#brand_box,#fl_box').hide();
		$("#sortField").val("BASE_PRICE");
		//切换价格排序值
		var sortType = $("#sync_sortType").val().trim();
		if(sortType == "ASC") {
			sortType = "DESC";
		} else {
			sortType = "ASC";
		}
		//全条件查询
		//品牌
		var brand_ids = [];
		$("#brand_container li.current").each(function(){
			brand_ids.push($(this).find("a").attr("brand_id"));
		});
		//分类
		category_ids = [];
		$("#category_container li.current").each(function(){
			category_ids.push($(this).find("a").attr("category_id"));
		});
		$("ul[id^='sub_category_container']").each(function(){
			$(this).find("li.current").each(function(){
				category_ids.push($(this).find("a").attr("category_id"));
			});
		});
		//关键字
		var search_key = $("#search_key").val();

		var prevBtn = $("#prevBtn").val();
		url = rootPath + "/wx/product/price/search";
		var form = $('<form></form>');  
	    form.attr('action', url);
	    form.attr('method', 'post');
	    form.attr('target', '_self');
	    if (prevBtn == "brandBtn") {
	    	form.append('<input type="hidden" name="brandIds" value="'+brand_ids.join(",")+'"/>');
			form.append('<input type="hidden" name="searchKey" value="'+search_key+'"/>');
	    } else if (prevBtn == "categoryBtn") {
	    	form.append('<input type="hidden" name="categoryId" value="'+category_ids.join(",")+'"/>');
	    } else if (prevBtn == "searchKeyBtn") {
			form.append('<input type="hidden" name="searchKey" value="'+search_key+'"/>');
	    }
	    form.append('<input type="hidden" name="sortField" value="BASE_PRICE"/>');
	    form.append('<input type="hidden" name="sortType" value="'+sortType+'"/>');
	    form.append('<input type="hidden" name="prevBtn" value="'+prevBtn+'"/>');
	    form.append('<input type="hidden" name="pageType" value="price"/>');
	    form.appendTo("body");
	    form.submit();
	});	
	
	//品牌条件筛选
	$("#brand_container a").click(function(){
		$(this).closest("li").toggleClass("current");
		
		//判断选项是否都已选择
		var lis = $("#brand_container li");
		var clis = $("#brand_container").find(".current"); 
		if (lis.length == clis.length) {
			$('#brand_box .qxbtn li').addClass('current');
		} else {
			$('#brand_box .qxbtn li').removeClass('current');
		}
	});
	
	// 根据品牌查询
	$("#btn_brand_search").click(function(){
		var brand_ids = [];
		$("#brand_container li.current").each(function(){
			brand_ids.push($(this).find("a").attr("brand_id"));
		});
		//分类
		var category_ids = [];
		$("#category_container li.current").each(function(){
			category_ids.push($(this).find("a").attr("category_id"));
		});
		$("ul[id^='sub_category_container']").each(function(){
			$(this).find("li.current").each(function(){
				category_ids.push($(this).find("a").attr("category_id"));
			});
		});
		
		var search_key = $("#search_key").val();
		var sortField = $("#sync_sortField").val();
		var sortType = $("#sync_sortType").val();
		url = rootPath + "/wx/product/price/search";
		var form = $('<form></form>');  
	    form.attr('action', url);
	    form.attr('method', 'post');
	    form.attr('target', '_self');
	    form.append('<input type="hidden" name="brandIds" value="'+brand_ids.join(",")+'"/>');
	    form.append('<input type="hidden" name="categoryId" value="'+category_ids.join(",")+'"/>');
	    form.append('<input type="hidden" name="searchKey" value="'+search_key+'"/>');
	    form.append('<input type="hidden" name="sortField" value="'+sortField+'"/>');
	    form.append('<input type="hidden" name="sortType" value="'+sortType+'"/>');
	    form.append('<input type="hidden" name="prevBtn" value="brandBtn"/>');
	    form.append('<input type="hidden" name="pageType" value="brand"/>');
	    form.appendTo("body");
	    form.submit();
	    
		//记录按钮事件(价格排序用)
		$("#prevBtn").val("btn_brand_search");
	});
	
	//全选/全不选子分类
	$('#brand_box .qxbtn li').click(function(){
		$(this).toggleClass('current');
		if($(this).hasClass('current')) {
			$("#brand_container li").removeClass('current').addClass('current');
		} else {
			$("#brand_container li").toggleClass('current');
		}
	});
	
	// 品牌查询条件重置
	$("#btn_brand_reset").click(function(){
		$('#brand_box .qxbtn li').removeClass("current");
		$("#brand_container li").removeClass("current");
	});
	
	//*******************************************************************************************
	//*******************************************************************************************
	//默认显示第一个分类的子分类
	$("ul[id^='sub_category_container']").hide(); 
	
	var currentCategory = $("#category_container").find(".current");
	if (currentCategory.length > 0) {
		var category_id = currentCategory.find("a").attr("category_id");
		$("#sub_category_container_"+category_id).show(); 
	} else {
		$("ul[id^='sub_category_container']:eq(0)").show(); 
	}
	
	//分类条件筛选
	$("#category_container a").click(function(){
		// 所有ul全部隐藏
		$("ul[id^='sub_category_container']").hide(); 
		var category_id = $(this).attr("category_id");
		var sub_category_container = $("#sub_category_container_"+category_id);
		// 对应二级分类ul 显示
		sub_category_container.show();
		
		var subCategoryList = eval($(this).attr("sub_category_list_json"));
		if(subCategoryList && subCategoryList.length > 0){
			// 如果二级分类为空，重新生成；如果已经有二级分类，菜单不再生成（页面不二次生成内容 ）
			if(sub_category_container.find("li").length == 0){
				for(var i = 0; i < subCategoryList.length; i++){
					var li = $("<li><a href=\"javascript:void(0)\" category_id=\""+subCategoryList[i].id+"\"><span>"+subCategoryList[i].categoryName+"</span><i></i></a></li>");				
					sub_category_container.append(li);
					li.find("a").click(function(){
						//$("ul[id^='sub_category_container'] li").removeClass('current');
						$(this).closest("li").toggleClass("current");
					});
				}
			}
		}
		
		if ($(this).closest("li").hasClass("current")) {
			$(".pp_list ul li").removeClass("current");
			$("#category_container li").removeClass('current');
		} else {
			$(".pp_list ul li").removeClass("current");
			$("#category_container li").removeClass('current');
			$(this).closest("li").addClass('current');
		}
		
	});
	
	$("ul[id^='sub_category_container'] a").click(function(){
		//$("ul[id^='sub_category_container'] li").removeClass('current');
		$(this).closest("li").toggleClass("current");
		//获取父分类ID
		var parentCategoryId = $(this).parent().parent().attr("id").replace("sub_category_container_", "");
		//设置父分类为选中状态
		$("#category_container a[category_id='"+parentCategoryId+"']").closest("li").addClass('current');
		
		//判断选项是否都已选择
		var categoryId = $(this).attr("category_id");
		var lis = $(this).parent().parent().find("li"); 
		var clis = $("#"+$(this).parent().parent().attr("id")).find(".current")
		if (lis.length == clis.length) {
			$('#fl_box .qxbtn li').addClass('current');
		} else {
			$('#fl_box .qxbtn li').removeClass('current');
		}
	});
	
	//全选/全不选子分类
	$('#fl_box .qxbtn li').click(function(){
		$(this).toggleClass('current');
		if($(this).hasClass('current')) {
			$(this).parent().parent().find("ul[id^='sub_category_container']:visible li").removeClass('current').addClass('current');
		} else {
			$(this).parent().parent().find("ul[id^='sub_category_container']:visible li").toggleClass('current');
		}
	});
	
	// 根据类型查询
	$("#btn_category_search").click(function(){
		//品牌
		var brand_ids = [];
		$("#brand_container li.current").each(function(){
			brand_ids.push($(this).find("a").attr("brand_id"));
		});
		/* $("ul[id^='sub_brand_container']").each(function(){
			$(this).find("li.current").each(function(){
				brand_ids.push($(this).find("a").attr("brand_id"));
			});
		}); */
		//分类
		var category_ids = [];
		if ($("ul[id^='sub_category_container']").find("li.current").length == 0) {
			$("#category_container li.current").each(function(){
				category_ids.push($(this).find("a").attr("category_id"));
			});
		}
		$("ul[id^='sub_category_container']").each(function(){
			$(this).find("li.current").each(function(){
				category_ids.push($(this).find("a").attr("category_id"));
			});
		});
		
		url = rootPath + "/wx/product/price/search";
		var sortField = $("#sync_sortField").val();
		var sortType = $("#sync_sortType").val();
	    var search_key = $("#search_key").val();
		var form = $('<form></form>');  
	    form.attr('action', url);
	    form.attr('method', 'post');
	    form.attr('target', '_self');
	    form.append('<input type="hidden" name="categoryId" value="'+category_ids.join(",")+'"/>');
	    form.append('<input type="hidden" name="brandIds" value="'+brand_ids.join(",")+'"/>');
	    form.append('<input type="hidden" name="sortField" value="'+sortField+'"/>');
	    form.append('<input type="hidden" name="sortType" value="'+sortType+'"/>');
	    form.append('<input type="hidden" name="prevBtn" value="categoryBtn"/>');
	    form.append('<input type="hidden" name="pageType" value="category"/>');
	    form.append('<input type="hidden" name="searchKey" value="'+search_key+'"/>');
	    form.appendTo("body");
	    form.submit();
	    
		//记录按钮事件(价格排序用)
		$("#prevBtn").val("btn_category_search");
	});
	
	//全部分类按钮点击事件
	$("#btn_category_all").click(function(){
		url = rootPath + "/wx/product/price/search";
		var sortField = $("#sync_sortField").val();
		var sortType = $("#sync_sortType").val();
		var search_key = $("#search_key").val();
		var form = $('<form></form>');  
	    form.attr('action', url);
	    form.attr('method', 'post');
	    form.attr('target', '_self');
	    form.append('<input type="hidden" name="sortField" value="'+sortField+'"/>');
	    form.append('<input type="hidden" name="sortType" value="'+sortType+'"/>');
	    form.append('<input type="hidden" name="prevBtn" value="categoryBtn"/>');
	    form.append('<input type="hidden" name="pageType" value="category"/>');
	    form.append('<input type="hidden" name="searchKey" value="'+search_key+'"/>');
	    form.appendTo("body");
	    form.submit();
	    
		//记录按钮事件(价格排序用)
		$("#prevBtn").val("btn_category_search");
	})
	
	// 分类查询条件重置
	$("#btn_category_reset").click(function(){
		$('#fl_box .qxbtn li').removeClass("current");
		$("#category_container li").removeClass("current");
		$("ul[id^='sub_category_container']").each(function(){
			$(this).find("li").removeClass("current");
		});
	});
	
	
	// 关键字查询
	$("#search_key").keydown(function(event){
		if(event.keyCode==13){ 
			funKeywordSearch();
		}
	});
	
	//搜索
	$("#doSearch").click(function(){
		funKeywordSearch();
	});
	
	function funKeywordSearch() {
		var search_key = $("#search_key").val();
		var sortField = $("#sync_sortField").val();
		var sortType = $("#sync_sortType").val();
		
		//品牌
		var brand_ids = [];
		$("#brand_container li.current").each(function(){
			brand_ids.push($(this).find("a").attr("brand_id"));
		});

		//分类
		var category_ids = [];
		$("#category_container li.current").each(function(){
			category_ids.push($(this).find("a").attr("category_id"));
		});
		$("ul[id^='sub_category_container']").each(function(){
			$(this).find("li.current").each(function(){
				category_ids.push($(this).find("a").attr("category_id"));
			});
		});
		
		url = rootPath + "/wx/product/price/search";
		var form = $('<form></form>');  
	    form.attr('action', url);
	    form.attr('method', 'post');
	    form.attr('target', '_self');
	    form.append('<input type="hidden" name="searchKey" value="'+search_key+'"/>');
	    form.append('<input type="hidden" name="categoryId" value="'+category_ids.join(",")+'"/>');
	    form.append('<input type="hidden" name="brandIds" value="'+brand_ids.join(",")+'"/>');
	    form.append('<input type="hidden" name="sortField" value="'+sortField+'"/>');
	    form.append('<input type="hidden" name="sortType" value="'+sortType+'"/>');
	    form.append('<input type="hidden" name="prevBtn" value="searchKeyBtn"/>');
	    form.appendTo("body");
	    form.submit();
		//记录按钮事件(价格排序用)
		$("#prevBtn").val("search_key");
		//去除默认的高亮
		$("#defaultbtn").parent().removeClass('current');
	}
	
	//默认查询
	$("#defaultbtn").click(function(){
		$(this).parent().toggleClass('current');
		var brand_ids = [];
		$("#brand_container li.current").each(function(){
			brand_ids.push($(this).find("a").attr("brand_id"));
		});
		//分类
		var category_ids = [];
		$("#category_container li.current").each(function(){
			category_ids.push($(this).find("a").attr("category_id"));
		});
		$("ul[id^='sub_category_container']").each(function(){
			$(this).find("li.current").each(function(){
				category_ids.push($(this).find("a").attr("category_id"));
			});
		});
		var search_key = $("#search_key").val();
		url = rootPath + "/wx/product/price/search";
		var form = $('<form></form>');  
	    form.attr('action', url);
	    form.attr('method', 'post');
	    form.attr('target', '_self');
	    //form.append('<input type="hidden" name="searchKey" value="'+search_key+'"/>');
	    //form.append('<input type="hidden" name="categoryId" value="'+category_ids.join(",")+'"/>');
	    //form.append('<input type="hidden" name="brandIds" value="'+brand_ids.join(",")+'"/>');
	    form.append('<input type="hidden" name="pageType" value="default"/>');
	    form.appendTo("body");
	    form.submit();
	});
	
	$("li[name='product_info']").each(function(){
		$(this).click(function(){
			var product_id = $(this).find("#product_id").val();
			url = rootPath + "/wx/product/detail";
			var form = $('<form></form>');  
		    form.attr('action', url);
		    form.attr('method', 'post');
		    form.attr('target', '_self');
		    form.append('<input type="hidden" name="productId" value="'+product_id+'" />');
		    form.appendTo("body");
		    form.submit();
		});
	});
	
	
	// 上拉加载更多
	$(window).on('scroll',function(){
	    if($(window).scrollTop()>=$(document).height()-$(window).height()){
	    	var page_count = $("#sync_page_count").val();
	    	var current_page = $("#sync_page_num").val();
	    	if(parseInt(current_page) >= parseInt(page_count)){
	    		//layer.msg('已经到底了',{time:500});
	    		return false;
	    	}
	      	var params = "requestType=sync";
	    	$("input[id^='sync_']").each(function(){
	    		if($(this).attr("pname") == "pageNum"){
	    			params = params + "&"+$(this).attr("pname")+"="+(parseInt($(this).val())+1);
	    		}else{
	    			params = params + "&"+$(this).attr("pname")+"="+$(this).val();
	    		}
	      	});
	    	
	    	$(this).parent().toggleClass('current');
			var brand_ids = [];
			$("#brand_container li.current").each(function(){
				brand_ids.push($(this).find("a").attr("brand_id"));
			});
			//分类
			var category_ids = [];
			$("#category_container li.current").each(function(){
				category_ids.push($(this).find("a").attr("category_id"));
			});
			$("ul[id^='sub_category_container']").each(function(){
				$(this).find("li.current").each(function(){
					category_ids.push($(this).find("a").attr("category_id"));
				});
			});
		    params = params + "&categoryId="+category_ids.join(",");
		    params = params + "&brandIds="+brand_ids.join(",");
			var prevBtn = $("#prevBtn").val();
			params = params + "&prevBtn="+prevBtn;
			var url = rootPath + "/wx/product/price/search";
			$.ajax({
				type : "post",
				url : url,
				data : params,
				datatype : "json",
				success : function(jsonObject) {
					var json = $.parseJSON(jsonObject);
					$("#sync_page_num").val(json.currentPage);
					if(json.recordList){
						$("#load_more_div").remove();
						for(var i = 0 ; i < json.recordList.length; i++){
							var product = json.recordList[i];
							var product_price_str = "<li  name=\"product_info\">"+
											            "<div class=\"box4\">"+
										                	"<h2>"+
										                		"<input type=\"hidden\"  id=\"product_id\"  value='"+ product.id + "' />"+
										                    	"<a href=\"javascript:void(0)\">"+product.productName+"</a>"+
										                    "</h2>"+
										                    "<h3>"+
										                    	"<strong>¥<em>"+numberInteger(product.basePrice)+"</em>"+
																				numberDecimal(product.basePrice)+
										                    	"</strong>"+
										                    	"<b style='display:none;'>新品</b>"+
										                    "</h3>"+
										                "</div>"+
										            "</li>";
									          
							$("#product_price_list").append($(product_price_str));
							
							$("li[name='product_info']").each(function(){
								$(this).click(function(){
									var product_id = $(this).find("#product_id").val();
									url = rootPath + "/wx/product/detail";
									var form = $('<form></form>');  
								    form.attr('action', url);
								    form.attr('method', 'post');
								    form.attr('target', '_self');
								    form.append('<input type="hidden" name="productId" value="'+product_id+'"/>');
								    form.appendTo("body");
								    form.submit();
								});
							});
						}
						
						var load_more = "<li id=\"load_more_div\">"+
									            "<div class=\"box4\" style=\"text-align:center;\">"+
							                	"<h2>加载中.......</h2>"+
							                "</div>"+
							            "</li>";
						if(json.currentPage  == json.pageCount){
							load_more = "<li id=\"load_more_div\">"+
									            "<div class=\"box4\" style=\"text-align:center;\">"+
							                	"<h2>没有更多内容啦 </h2>"+
							                "</div>"+
							            "</li>";
						}
						$("#product_price_list").append($(load_more));
					}
				},
				error : function() {
					layer.msg('查询商品失败',{time:1000});
				}
			});
	    }
	})
});

</script>
</head>
<body style="background:#f5f5f5">
<c:set var="rootPath" value="<%=basePath %>"></c:set>
<c:set var="imgRootURL" value="<%=imgRootURL %>"></c:set>

<c:forEach items="${hiddenParamMap }" var="item">
	<input type="hidden"  id="sync_${item.key }" pname="${item.key}" value="${item.value}"/>
</c:forEach>
	<input type="hidden" id="sync_sortField" value="${sortField }"/>
	<input type="hidden" id="sync_sortType" value="${sortType }"/>
<input type="hidden"  id="sync_page_num" pname="pageNum"  value="${pageBean.currentPage }"/>
<input type="hidden"  id="sync_num_per_page" pname="numPerPage" value="${pageBean.numPerPage}"/>
<input type="hidden"  id="sync_page_count"  pname="pageCount" value="${pageBean.pageCount }"/>

<div class="search_part13">
	<div class="search_part13_con"><div class="search_part13_con1">
    	<i></i>
        <p>
        	<input type="text" name="searchKey" id="search_key" class="inputstyle1" value="${searchKey }" placeholder="一体机" />
        </p>
	    <a id="doSearch" href="javascript:void(0);">搜索<u></u></a>
    </div></div>
</div>
<div class="headerfixed2"></div>
<div class="fl_nav1">
	<ul>
    	<li <%-- <c:if test="${sortField eq 'SORT_NO' }"> </c:if> --%> <c:if test="${pageType eq 'default' }">class="current"</c:if>>
        	<a href="javascript:void(0)" id="defaultbtn" ><span>全部商品</span></a>
        </li>
        <li <c:if test="${pageType eq 'category' or not empty categoryIds }">class="current"</c:if> >
        	<a href="javascript:void(0)" id="flbtn"><span>分类</span><i></i></a>
        </li>
        <li <c:if test="${pageType eq 'brand' or not empty brandIds }">class="current"</c:if>>
        	<a href="javascript:void(0)" id="brandbtn"><span>品牌</span><i></i></a>
        </li>
        <li <c:if test="${sortField eq 'BASE_PRICE' }"> </c:if> <c:if test="${pageType eq 'price' }">class="current"</c:if> >
        	<a href="javascript:void(0)" id="pricebtn">
        		<span>价格</span>
        		<c:choose>
					<c:when test="${sortField eq 'BASE_PRICE' }">
						<img src="<%=basePath %>/statics/images/${sortType}.png" style="vertical-align: middle;" />
					</c:when>
					<c:otherwise>
						<em></em>
					</c:otherwise>
				</c:choose>
        	</a>
        	<input type="hidden" id="prevBtn" value="${prevBtn }"/>
        </li>
        
    </ul>
</div>

<%--品牌筛选弹层 --%>
<div class="fl_dropdown" style="display:none" id="brand_box">
	<c:set var="brandIdArr" value="${fn:split(brandIds, ',') }" ></c:set>
	<div class="pp_box">
    	<%-- <div class="pp_left">
    		<ul id="brand_container">
        		<c:forEach items="${brandList}" var="brand" varStatus="ind">
        			<c:set var="existsFlag" value="false" ></c:set>
           			<c:forEach items="${brandIdArr }" var="brandId" varStatus="c">
						<c:if test="${brandId eq brand.brandCode }">
							<c:set var="existsFlag" value="true"></c:set>
						</c:if>
					</c:forEach>
					<c:choose>
						<c:when test="${existsFlag }">
							<li class="current"><a href="javascript:void(0)" brand_id="${brand.brandCode}" sub_brand_list_json="${brand.subBrandListStr }">${brand.brandNameCh}<i></i></a></li>
						</c:when>
						<c:otherwise>
							<li><a href="javascript:void(0)" brand_id="${brand.brandCode}" sub_brand_list_json="${brand.subBrandListStr }">${brand.brandNameCh}<i></i></a></li>
						</c:otherwise>
					</c:choose>
        		</c:forEach>
            </ul>
        </div> --%>
        <div class="pp_right" style="margin-left: .2rem;margin-right:0.2rem">
        	<div class="pp_list" >
        		<ul class="qxbtn">
	        		<li style="text-align:right;border-bottom:0.02rem solid #ddd;"><a href="javascript:void(0)" style="padding-right:0.7rem"><span>全选</span><i></i></a></li>
        		</ul>
        		
        		<ul class="fl_list11"  id="brand_container">
            	<c:forEach items="${brandList}" var="brand" varStatus="ind">
	            	
	            		<c:set var="existsFlag" value="false" ></c:set>
	           			<c:forEach items="${brandIdArr }" var="brandId" varStatus="c">
							<c:if test="${brandId eq brand.brandCode }">
								<c:set var="existsFlag" value="true"></c:set>
							</c:if>
						</c:forEach>
						<c:choose>
							<c:when test="${existsFlag }">
								<li class="current"><a href="javascript:void(0)" brand_id="${brand.brandCode}" >${brand.brandNameCh}<i></i></a></li>
							</c:when>
							<c:otherwise>
								<li><a href="javascript:void(0)" brand_id="${brand.brandCode}" >${brand.brandNameCh}<i></i></a></li>
							</c:otherwise>
						</c:choose>
					
		            	<%-- <c:if test="${ind.index == 0 }">
		            		<c:forEach items="${defaultSubBrandList }" var="fbrand">
		            			<c:set var="existsFlag" value="false" ></c:set>
		            			<c:forEach items="${brandIdArr }" var="brandId" varStatus="c">
									<c:if test="${brandId eq fbrand.brandCode }">
										<c:set var="existsFlag" value="true"></c:set>
									</c:if>
								</c:forEach>
								<c:choose>
									<c:when test="${existsFlag }">
										<li class="current"><a href="javascript:void(0)" brand_id="${fbrand.brandCode}"><span>${fbrand.brandNameCh}</span><i></i></a></li>
									</c:when>
									<c:otherwise>
										<li><a href="javascript:void(0)" brand_id="${fbrand.brandCode}"><span>${fbrand.brandNameCh}</span><i></i></a></li>
									</c:otherwise>
								</c:choose>
		            		</c:forEach>
		            	</c:if> --%>
                </c:forEach>
	           </ul>
            </div>
        </div>
        <div class="operate_part">
        	<ul>
            	<li style="width:50%">
                	<a href="javascript:void(0)" id="btn_brand_reset" class="btn1">重置</a>
                </li>
                <li style="width:50%">
                	<a href="javascript:void(0)" id="btn_brand_search" class="btn2">确定</a>
                </li>
            </ul>
        </div>
    </div>
</div>


<%--商品分类 --%>
<div class="fl_dropdown" style="display:none" id="fl_box">
	<c:set var="categoryIdArr" value="${fn:split(categoryIds, ',') }" ></c:set>
	<div class="pp_box">
    	<div class="pp_left">
        	<ul id="category_container">
        		<c:forEach items="${topCategoryList }" var="category">
        			<c:set var="existsFlag" value="false" ></c:set>
           			<c:forEach items="${categoryIdArr }" var="categoryId" varStatus="c">
						<c:if test="${categoryId eq category.id }">
							<c:set var="existsFlag" value="true"></c:set>
						</c:if>
					</c:forEach>
					<c:choose>
						<c:when test="${existsFlag }">
							<li class="current"><a href="javascript:void(0)" category_id = "${category.id}" sub_category_list_json="${category.subCategoryListStr }">${category.categoryName}<i></i></a></li>
						</c:when>
						<c:otherwise>
							<li><a href="javascript:void(0)" category_id = "${category.id}" sub_category_list_json="${category.subCategoryListStr }">${category.categoryName}<i></i></a></li>
						</c:otherwise>
					</c:choose>
        		</c:forEach>
            </ul>
        </div>
        <div class="pp_right">
        	<div class="pp_list">
        		<ul class="qxbtn">
	        		<li style="text-align:right;border-bottom:0.02rem solid #ddd;"><a href="javascript:void(0)" style="padding-right:0.7rem"><span>全选</span><i></i></a></li>
        		</ul>
        		<c:forEach items="${topCategoryList }" var="category">
        			<ul  id="sub_category_container_${category.id}">
        				<c:forEach items="${category.subCategoryList }" var="subCategory">
							<c:set var="existsFlag" value="false" ></c:set>
		           			<c:forEach items="${categoryIdArr }" var="categoryId" varStatus="c">
								<c:if test="${categoryId eq subCategory.id }">
									<c:set var="existsFlag" value="true"></c:set>
								</c:if>
							</c:forEach>
							<c:choose>
								<c:when test="${existsFlag }">
									<li class="current"><a href="javascript:void(0)" category_id = "${subCategory.id}" ><span>${subCategory.categoryName}</span><i></i></a></li>
								</c:when>
								<c:otherwise>
									<li><a href="javascript:void(0)" category_id = "${subCategory.id}" ><span>${subCategory.categoryName}</span><i></i></a></li>
								</c:otherwise>
							</c:choose>
        				</c:forEach>
	                </ul>
        		</c:forEach>
            </div>
        </div>
        <div class="operate_part">
        	<ul>
            	<li>
                	<a href="javascript:void(0);" id="btn_category_all" class="btn1">全部分类<i></i></a>
                </li>
                <li>
                	<a href="javascript:void(0);" id="btn_category_reset" class="btn1">重置</a>
                </li>
                <li>
                	<a href="javascript:void(0)" id="btn_category_search" class="btn2">确定</a>
                </li>
            </ul>
        </div>
    </div>
</div>

<div class="bjd_list">
	<div class="bjd_list_con">
    	<ul id="product_price_list">
    		<c:forEach items="${productList}" var="product">
        	<li name="product_info">
            	<div class="box4">
                	<h2>
                		<input type="hidden"  id="product_id"  value="${product.id}"/>
                    	<a href="javascript:void(0)">${product.productName }</a>
                    </h2>
                    <h3>
                    	<strong>¥<em>
                    		<sl:nformat num="${product.productPrice}" format=".00" type="2"/></em>
							<sl:nformat num="${product.productPrice}" format=".00" type="3"/>
                    	</strong>
                    	<%--
                    	<b>新品</b>
                    	--%>
                    </h3>
                </div>
            </li>
            </c:forEach>
            <c:if test="${pageBean.pageCount == 0 }">
            	<li id="load_more_div">
            		<div class="box4" style="text-align:center;">
						<h2>查询无数据</h2>
					</div>
				</li>
            </c:if>
            <c:if test="${pageBean.pageCount == pageBean.currentPage }">
            	<li id="load_more_div">
            		<div class="box4" style="text-align:center;">
						<h2>没有更多数据啦</h2>
					</div>
				</li>
            </c:if>
            <c:if test="${pageBean.pageCount > 0 && pageBean.pageCount != pageBean.currentPage }">
            	<li id="load_more_div">
            		<div class="box4" style="text-align:center;">
						<h2>加载中.......</h2>
					</div>
				</li>
            </c:if>
            
        </ul>
    </div>
</div>
<jsp:include page="../wx_footer.jsp" />
</body>
</html>